import cv2
import numpy


dirPath = 'data/'
DataFile = open('test', 'w')
for i in range(0, 10):
    for j in range(400, 500):
        writeContent = ''
        filePath = dirPath + str(i) + '/' + str(j) + '.jpg'
        tempData = cv2.imread(filePath)
        tempData = cv2.cvtColor(tempData, cv2.COLOR_BGR2GRAY)
        tempData = tempData.reshape(1, 400)
        writeContent += str(i) + ' '
        for k in range(0, 400):
            pointData = 1
            if tempData.item(0, k) < 100:
                pointData = 0
            writeContent += str(k+1) + ':' + str(pointData) + ' '
        writeContent += '\n'
        DataFile.write(writeContent)